import './index.less';
import React from "react";
import { componentClass, ComponentProps } from "../../../../common/Component";

export interface AProps extends ComponentProps{
    href?: string
}

export function A(props: React.PropsWithChildren<AProps>){
    return <a href={props.href} className={componentClass(props, 'apps-markdown-a')}>
    {props.children}
    </a>
}

export interface ImgProps extends ComponentProps{
    src?: string,
    width?: string,
    center?: boolean
}

export function Img(props: React.PropsWithChildren<ImgProps>){
    return <img src={props.src} className={componentClass(props, 'apps-markdown-img')} 
        style={{'margin': (props.center ? 'auto' : '' ), 'width': ( props.width || 'auto')}}>
    {props.children}
    </img>
}
